/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2022 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32h7xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define ps2_clk_Pin GPIO_PIN_2
#define ps2_clk_GPIO_Port GPIOE
#define ps2_cs_Pin GPIO_PIN_3
#define ps2_cs_GPIO_Port GPIOE
#define ps2_DO_Pin GPIO_PIN_4
#define ps2_DO_GPIO_Port GPIOE
#define ps2_DI_Pin GPIO_PIN_5
#define ps2_DI_GPIO_Port GPIOE
#define LF_Pin GPIO_PIN_0
#define LF_GPIO_Port GPIOA
#define RF_Pin GPIO_PIN_1
#define RF_GPIO_Port GPIOA
#define SPI_IRQ_Pin GPIO_PIN_4
#define SPI_IRQ_GPIO_Port GPIOA
#define SPI_IRQ_EXTI_IRQn EXTI4_IRQn
#define LR_Pin GPIO_PIN_7
#define LR_GPIO_Port GPIOA
#define RR_Pin GPIO_PIN_0
#define RR_GPIO_Port GPIOB
#define SPI_CSN_Pin GPIO_PIN_1
#define SPI_CSN_GPIO_Port GPIOB
#define SPI_CE_Pin GPIO_PIN_2
#define SPI_CE_GPIO_Port GPIOB
#define EN1A_Pin GPIO_PIN_8
#define EN1A_GPIO_Port GPIOE
#define EN1A_EXTI_IRQn EXTI9_5_IRQn
#define EN1B_Pin GPIO_PIN_9
#define EN1B_GPIO_Port GPIOE
#define EN2A_Pin GPIO_PIN_10
#define EN2A_GPIO_Port GPIOE
#define EN2A_EXTI_IRQn EXTI15_10_IRQn
#define EN2B_Pin GPIO_PIN_11
#define EN2B_GPIO_Port GPIOE
#define EN3A_Pin GPIO_PIN_12
#define EN3A_GPIO_Port GPIOE
#define EN3A_EXTI_IRQn EXTI15_10_IRQn
#define EN3B_Pin GPIO_PIN_13
#define EN3B_GPIO_Port GPIOE
#define EN4A_Pin GPIO_PIN_14
#define EN4A_GPIO_Port GPIOE
#define EN4A_EXTI_IRQn EXTI15_10_IRQn
#define EN4B_Pin GPIO_PIN_15
#define EN4B_GPIO_Port GPIOE
#define LF_O1_Pin GPIO_PIN_12
#define LF_O1_GPIO_Port GPIOB
#define LF_O2_Pin GPIO_PIN_13
#define LF_O2_GPIO_Port GPIOB
#define RR_O1_Pin GPIO_PIN_11
#define RR_O1_GPIO_Port GPIOD
#define RR_O2_Pin GPIO_PIN_12
#define RR_O2_GPIO_Port GPIOD
#define LR_O2_Pin GPIO_PIN_0
#define LR_O2_GPIO_Port GPIOD
#define LR_O1_Pin GPIO_PIN_1
#define LR_O1_GPIO_Port GPIOD
#define RF_O1_Pin GPIO_PIN_3
#define RF_O1_GPIO_Port GPIOD
#define RF_O2_Pin GPIO_PIN_4
#define RF_O2_GPIO_Port GPIOD
/* USER CODE BEGIN Private defines */

#define DLY_TIM_Handle (&htim6)
void delay_us(uint16_t nus);
//void open_door(void);
//void close_door(void);

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
